package com.xyh.controller;

import com.xyh.po.MyClass;
import com.xyh.service.MyClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @Author:kyle
 * @Date:2020/12/23 - 23:04
 * @Project:spring_StudentsDormitoryManagementSystem
 * @Package:com.xyh.controller
 * @Version:1.0
 */
@Controller
public class MyClassController {
    @Autowired
    private MyClassService myClassService;

    @RequestMapping("/school/bj")
    public String listMyClasses(ModelMap modelMap){

        List<MyClass> myClasses = myClassService.list();
        modelMap.addAttribute("myClasses",myClasses);
        return "myClass";
    }
}
